package com.streamsets.datacollector.pileline.enums;

import java.util.ArrayList;

/**
 *  管道，值替换stage的配置名称枚举
 * @author wengzhonghui
 * @date 2019/10/16 19:04
 */
public enum FieldValueReplacerConfigEnum {

    nullReplacerConditionalConfigs("nullReplacerConditionalConfigs" ,new ArrayList<String>()),
    fieldsToReplaceIfNull("fieldsToReplaceIfNull" ,new ArrayList<String>()),
    fieldsToConditionallyReplace("fieldsToConditionallyReplace" ,new ArrayList<String>());


     FieldValueReplacerConfigEnum(String name, Object defaultValue) {
        this.name = name;
        this.defaultValue = defaultValue;
    }
    private String name;

    private Object defaultValue;

    public static FieldValueReplacerConfigEnum valueOfName(String name){
        for(FieldValueReplacerConfigEnum type : FieldValueReplacerConfigEnum.class.getEnumConstants()){
            if (name.equalsIgnoreCase(type.getName())){
                return type;
            }

        }
        throw new IllegalArgumentException("name:" + name + " is not a valid "
                + "Types.java value.");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Object getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(Object defaultValue) {
        this.defaultValue = defaultValue;
    }
}
